from enum import Enum

class OperationType(Enum):
    NOP = "NOP"
    DECLARE = "DECLARE"

    # 函数入口和出口
    ENTRY = "ENTRY"
    EXIT = "EXIT"

    # 赋值运算
    ASSIGN = "ASSIGN"

    # 算术运算
    ADD = "ADD"
    SUB = "SUB"
    MUL = "MUL"
    DIV = "DIV"
    MOD = "MOD"
    NEG = "NEG" # 负值

    # 比较运算
    GT = "GT"
    GE = "GE"
    LT = "LT"
    LE = "LE"
    EQUAL = "EQUAL"
    NOT_EQUAL = "NOT_EQUAL"

    # 逻辑运算
    NOT = "NOT"
    AND = "AND"
    OR = "OR"

    # 指针运算
    AMPERSAND = "AMPERSAND"
    SET = "SET" # 设置左值 eg: SET result arg1  <=  *arg1 = result
    GET = "GET" # 取右值 eg: GET result arg1  <=  result = *arg1

    # 跳转
    JMP = "JMP"
    JT = "JT"   # 为真跳转
    JF = "JF"   # 为假跳转
    JNE = "JNE" # 不相等跳转

    # 函数调用
    ARG = "ARG"     # 函数参数
    PROC = "PROC"   # 调用过程 eg: PROC func  <=  func()
    CALL = "CALL"   # 调用函数 eg: CALL result func  <=  result = func()
    RET = "RET"     # 直接返回
    RETV = "RETV"   # 带值返回
